// 质量管理请求
import request from '../service/service';

/**
 * 新增质量体系
 * @param  data {Object}
 */
export function addQualityFile(data) {
  return request({
    protocol: '/bus/quality/create',
    options: data
  });
}

/**
 * 删除质量体系
 * @param  data {Object}
 */
export function deleteQualityFile(data) {
  return request({
    protocol: '/bus/quality/deleteByIds?ids=' + data.ids,
    method: 'delete'
  });
}

/**
 * 根据Id 查询详情
 * @param  data {Object}
 */
export function getQualityDetail(data) {
  return request({
    protocol: '/bus/quality/findById',
    options: data,
    method: 'get'
  });
}

/**
 * 查询分页列表
 * @param  data {Object}
 */
export function getQualitySystemList(data) {
  return request({
    protocol: '/bus/quality/findPage',
    options: data,
    method: 'get'
  });
}

/**
 * 修改质量体系文件
 * @param  data {Object}
 */
export function EditQualityList(data) {
  return request({
    protocol: '/bus/quality/update',
    options: data
  });
}

/**
 * 查询所有桩基列表（DAM云小程序-桩基记录数据）
 * @param data {Object} 请求参数
 * project_name: "" // 必填，项目名
 * page":"0"//必填，页码，从0开始
 */
export function getPileList(data) {
  return request({
    protocol: 'dam/get_pile_list',
    options: data
  });
}

/**
 * DAM云小程序-质量检查--获取质量类型占比
 * @param  data {Object}
 */
export function getQualityLevelList(data) {
  return request({
    protocol: '/dam/getQualityLevelList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-根据月份-获取类型数量
 * @param  data {Object}
 */
export function getQualityNumsChart(data) {
  return request({
    // protocol: '/dam/getQualityNumsChart',
    protocol: '/dam/getQualityNumStatistic',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-获取质量整改占比
 * @param  data {Object}
 */
export function getQualityStateList(data) {
  return request({
    protocol: '/dam/getQualityStateList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-获取整改详情列表
 * @param  data {Object}
 */
export function getQualityList(data) {
  return request({
    protocol: '/dam/getQualityList',
    options: data,
    method: 'get'
  });
}

/**
 * 获取系统消息
 * @param  data {Object}
 */
export function getSystemMessage(data) {
  return request({
    protocol: '/dam/getSystemMessage',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-获取桩号列表
 * @param  data {Object}
 */
export function getStakeList(data) {
  return request({
    protocol: '/dam/getStakeList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-获取楼层集合
 * @param  data {Object}
 */
export function getFloorList(data) {
  return request({
    protocol: '/dam/getFloorList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-统计桩号完成情况
 * @param  data {Object}
 */
export function getStakeStatis(data) {
  return request({
    protocol: '/dam/getStakeStatis',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-质量检查-统计桩号步骤情况
 * @param  data {Object}
 */
export function getStakeStepStatis(data) {
  return request({
    protocol: '/dam/getStakeStepStatis',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-安全管理-获取整改详情列表
 * @param  data {Object}
 */
export function getSecurityList(data) {
  return request({
    protocol: '/bus/security/getSecurityList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-安全管理-获取质量整改数量
 * @param  data {Object}
 */
export function getSecurityStateNum(data) {
  return request({
    protocol: '/bus/security/getSecurityStateNum',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-安全管理-获取系统消息
 * @param  data {Object}
 */
export function getSecuritySystemMessage(data) {
  return request({
    protocol: '/bus/security/getSecuritySystemMessage',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-安全管理-获取检查类型占比
 * @param  data {Object}
 */
export function getSecurityLevelList(data) {
  return request({
    protocol: '/bus/security/getSecurityLevelList',
    options: data,
    method: 'get'
  });
}

/**
 * DAM云小程序-安全管理-获取质量整改占比
 * @param  data {Object}
 */
export function getSecurityStateList(data) {
  return request({
    protocol: '/bus/security/getSecurityStateList',
    options: data,
    method: 'get'
  });
}

/**
 * 质安分页列表
 */
export function getQsInspectionList(data) {
  return request({
    protocol: '/bus/qs/inspection/findPage',
    options: data,
    method: 'get'
  });
}

/**
 * 获取个人质安区域数据
 */
export function getQsInPersonList(data) {
  return request({
    protocol: '/bus/qs/inspection/personQsPage',
    options: data,
    method: 'get'
  });
}

/**
 * 根据Id 查询质安详情
 */
export function getQsInspectionDetail(data) {
  return request({
    protocol: '/bus/qs/inspection/findById',
    options: data,
    method: 'get'
  });
}

/**
 * 质安新增
 */
export function addQsInspection(data) {
  return request({
    protocol: '/bus/qs/inspection/create',
    options: data,
    method: 'post'
  });
}

/**
 * 质安删除
 */
export function delQsInspection(data) {
  return request({
    protocol: '/bus/qs/inspection/deleteByIds',
    options: data,
    method: 'delete'
  });
}

/**
 * 获取质安区域数据
 */
export function getQsAreaTree(data) {
  return request({
    protocol: '/bus/qs/area/tree',
    options: data,
    method: 'get'
  });
}

/**
 * 新增质安区域数据
 */
export function addQsAreaTree(data) {
  return request({
    protocol: '/bus/qs/area/create',
    options: data,
    method: 'post'
  });
}

/**
 * 修改质安区域数据
 */
export function updateQsAreaTree(data) {
  return request({
    protocol: '/bus/qs/area/update',
    options: data,
    method: 'post'
  });
}

/**
 * 删除质安区域数据
 */
export function delQsAreaTree(data) {
  return request({
    protocol: '/bus/qs/area/deleteByIds',
    options: data,
    method: 'delete'
  });
}

/**
 * 获取初审角色
 */
export function getQsRoleList(data) {
  return request({
    protocol: '/bus/qs/role/findPage',
    options: data,
    method: 'get'
  });
}

/**
 * 新增初审角色
 */
export function addQsRole(data) {
  return request({
    protocol: '/bus/qs/role/create',
    options: data,
    method: 'post'
  });
}

/**
 * 修改初审角色
 */
export function updateQsRole(data) {
  return request({
    protocol: '/bus/qs/role/update',
    options: data,
    method: 'post'
  });
}

/**
 * 初审/整改/复核新增
 */
export function checkQsInspection(data) {
  return request({
    protocol: '/bus/qs/inspection/rectifyCreate',
    options: data,
    method: 'post'
  });
}
